
Ext.onReady(function() {
	
	$('#query_logout').click(function() {		//注销用户
		$('#query_logout').text('正在注销...');
		
		Ext.Ajax.request({
			url: '/szpxt-beta/query_logout',
			success: function(response, opts) {
				var obj = Ext.decode(response.responseText);
				if(obj.success) {
					document.location = '/szpxt-beta/main/home.jsp';
				}
			}
		});
	});
	
	//按钮颜色切换
	$('.submit, .clearForm').append('<span class="hover"></span>').each(function() {
		var $span = $('> span.hover', this).css('opacity', 0);
		$(this).hover(function() {
			$span.stop().fadeTo(500, 1);
		}, function() {
			$span.stop().fadeTo(500, 0);
		})
	});
	
	new Ext.form.FormPanel({
		id: 'extForm',
		baseCls: 'x-plain',
		width: 400,
		labelAlign: 'right',
		defaults: {xtype: 'textfield', width: 200, allowBlank: false},
		items: [
			{fieldLabel: '业务序列号', name: 'serialNumber'}
		],
		renderTo: 'form'
	});
	
	$('.clearForm').click(function() {
		Ext.getCmp('extForm').getForm().reset();	//清空
		Ext.getCmp('extForm').getForm().clearInvalid();
	})
	
})